// *********Admin端路由*************
// Containers
import Full from '@/containers/admin/Full'
// login
import Login from '@/views/admin/Login'
// Dashboard
import Dashboard from '@/views/admin/Dashboard'
// User
import UserIndex from '@/views/admin/User/Index'
// authGroup
import AuthGroup from '@/views/admin/AuthGroup/Index'
// MenuAuth
import MenuAuth from '@/views/admin/MenuAuth/Index'

export default [
  // admin 登录
  {
    path: '/admin/login',
    name: 'Login',
    component: Login
  },
  // admin 后台
  {
    path: '/admin',
    name: 'Admin',
    component: Full,
    redirect: '/admin/dashboard',
    meta: {
      title: '首页',
      requireAuth: true
    },
    children: [
      {
        path: 'dashboard',
        name: 'AdminDashboard',
        component: Dashboard,
        meta: {
          title: '仪表板',
          requireAuth: true
        }
      },
      {
        path: 'auth',
        name: 'Auth',
        redirect: '/admin/auth/authGroup',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '权限管理',
          requireAuth: true
        },
        children: [
          {
            path: 'authGroup',
            name: 'authGroup',
            component: AuthGroup,
            meta: {
              title: '分组列表',
              requireAuth: true
            }
          },
          {
            path: 'MenuAuth',
            name: 'MenuAuth',
            component: MenuAuth,
            meta: {
              title: '菜单权限',
              requireAuth: true
            }
          }
        ]
      },
      {
        path: 'user',
        name: 'user',
        component: UserIndex,
        meta: {
          title: '用户管理',
          requireAuth: true
        }
      }
    ]
  }
]
